<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/html">
<head>
    <title>补偿确认书</title>
    <#include "../common/common.ftl"/>
    <link rel="stylesheet" href="/style/contractForm.css" media="all">

</head>
<body style="overflow-y: hidden;">
<div class="layui-fluid">
    <blockquote class="layui-elem-quote layui-bg-white">
        补偿确认书【姓名：<span class="jmdf-color-red">${(contract.name)!}</span>】
        【协议编号：<span class="jmdf-color-red">${(contract.contractCode)!}</span>】
    </blockquote>
    <div class="layui-row layui-col-space15">
        <div class="layui-card">
            <div class="layui-tab layui-tab-brief" id="finance">
                <ul class="layui-tab-title">
                    <li source="/pdf/print/landHouseBcQrsPDF?contractId=${(contract.id)!}" class="layui-this">补偿确认书</li>
                </ul>
                <iframe id="printIframe" style="width: 100%;height: 730px;margin-top: 10px"></iframe>
            </div>
        </div>
    </div>
</div>
</body>
<script src="/layui/layui.js" charset="utf-8"></script>
<script src="/bigDecimal/BigDecimal-all-last.js"></script>
<script src="/bigDecimal/BigDecimal-all-last.min.js"></script>
<script src="/bigDecimal/common.js"></script>
<script>
    layui.config({
        base: '/modules/' //静态资源所在路径
    }).use(['jquery', 'layer', 'element', 'jmdf', 'verify', 'form'], function () {
        var $ = layui.jquery, form = layui.form, jmdf = layui.jmdf, layer = layui.layer, verify = layui.verify, element = layui.element;

//        打印链接调用
        function openPdf(source) {
            var url = source + "#toolbar=0";
            $("#printIframe").attr("src", url);
        };

        $("#finance li").click(function () {
            var source = $(this).attr("source");
            openPdf(source);
        });
        openPdf($("#finance li").attr("source"));

        //保存住宅、装修过度补助费
        form.on('submit(submit)', function (data) {
            $.ajax({
                url: "bzSave",
                type: "post",
                data: $("#financeForm").serialize(),
                success: function (data) {
                    if (data.code == "0001") {
                        layer.msg(data.message, {anim: 0, icon: 1, time: 500}, function () {
                            location.reload();
                        });
                    } else {//失败
                        layer.msg(data.message, {anim: 6, icon: 2, time: 3000});
                    }
                }
            });
            return false;
        });
    });

</script>
</html>
